fix: accept the skill names the Agent Skills spec allows (0.24.2) - #118
Open
singhharsh1708 wants to merge 1 commit into
Open
fix: accept the skill names the Agent Skills spec allows (0.24.2)#118singhharsh1708 wants to merge 1 commit into
singhharsh1708 wants to merge 1 commit into
Conversation
KSF's name rule required a leading letter and capped names at 41 characters. The spec allows any lowercase alphanumeric start and up to 64, so `2fa-setup` failed the rule, fell through to the directory-name fallback, lost its leading digit to a slug that strips everything before the first letter, and installed as `fa-setup` — a different skill from the one the author published, pinned and compiled under that name. The rule now accepts a leading digit and the spec's full length, and the slug keeps leading digits. Loosened in one direction only: `tidy--commits` and `tidy-` still load, since tightening a frozen field would break valid skills (RFC 0002); the name-convention lint added in 0.24.1 reports them. The directory-name fallback for an unloadable frontmatter name is unchanged — the spec wants name to match the parent directory.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-on to #117, from the other direction. That PR made kitbash warn about names the spec forbids. This one stops kitbash rejecting names the spec allows — and, worse, silently installing them under a different name.
The bug
KSF's rule was
^[a-z][a-z0-9-]{1,40}$: leading letter required, 41-character cap. The spec allows any lowercase alphanumeric start and up to 64 characters.So
2fa-setup— a legal Agent Skill — failed the rule, fell through to the directory-name fallback, and hit a slug that strips everything before the first letter:It was then pinned in
kitbash.lockasfa-setupand compiled into every target under that name. Nothing warned. For a tool whose whole argument is that silent capability loss is the enemy, renaming someone's skill on the way in is the wrong failure mode.A 64-character name — legal per the spec — was rejected outright by the 41-character cap for the same reason.
The fix
NAME_REbecomes^[a-z0-9][a-z0-9-]{0,63}$, and the bare-skill slug keeps leading digits instead of eating them.Loosened in one direction only.
tidy--commitsandtidy-still load: tightening a value constraint on a frozen manifest field would turn valid existing skills into load failures, which RFC 0002 rules out. Those names are reported by thename-conventionlint from #117, which is where a host-compatibility problem belongs.The directory-name fallback is unchanged. A frontmatter name KSF cannot load still falls back to the directory, because the spec requires
nameto match the parent directory — propagating a mismatched name would produce a skill hosts silently drop. I started to make that an error and reverted it: thename-invarianttest added in 0.24.0 documents the current behaviour as deliberate, and it is right.Tests
Four new assertions in the existing
spec-nameblock, each failing before the change:kitbash.lockpinning2fa-setup, notfa-setupname-invariantfallback still holdFull suite green (460 assertions), typecheck clean, benchmark deterministic,
site/build.mjs --checkcurrent.Context
Found while re-reading the published Agent Skills spec against the implementation. The spec is now the shared authority for eleven targets, so its exact constraints — 1–64 characters, lowercase alphanumerics and single hyphens, name matching the parent directory, description ≤1024 characters, body under ~5,000 tokens — are worth holding the loader to in both directions, not just the strict one.